package com.sskj.gocoin.p.activity;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.MyAppLication;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.bean.UserBean;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;
import com.sskj.gocoin.utils.ToastUtil;
import com.sskj.gocoin.v.activity.ZwPwdLoginActivity;


public class ZwPwdLoginPresenter extends BasePresenter<ZwPwdLoginActivity> {


    public void checkPwdLogin(String pws) {
        OkGo.<HttpData<UserBean>>post(HttpConfig.BASE_URL + HttpConfig.CHECK_PWD)
                .params("mobile", MyAppLication.getMobile())
                .params("opwd", pws)
                .execute(new JsonCallBack<HttpData<UserBean>>(this) {
                    @Override
                    public void _onSuccess(Response<HttpData<UserBean>> response) {
                        HttpData<UserBean> httpListData = response.body();
                        if (httpListData.getStatus() == 200) {
                            mView.loginSuccess();
                        } else {
                            ToastUtil.showShort(httpListData.getMsg());
                        }
                    }
                });
    }
}
